/**
 * TabBar配置管理
 * 统一管理原生TabBar和自定义TabBar的配置
 */

export const tabbarConfig = {
  color: "#7A7E83",
  selectedColor: "#EE0A24", 
  borderStyle: "black",
  backgroundColor: "#ffffff",
  list: [
    {
      pagePath: "pages/home/home",
      iconPath: "/static/img/tabbar/icon-home.png",
      selectedIconPath: "/static/img/tabbar/icon-home-selected.png",
      text: "首页",
      name: "home"
    },
    {
      pagePath: "pages/category/category",
      iconPath: "/static/img/tabbar/icon-category.png",
      selectedIconPath: "/static/img/tabbar/icon-category-selected.png",
      text: "分类",
      name: "category"
    },
    {
      pagePath: "pages/feiyi/feiyi",
      iconPath: "/static/img/tabbar/icon-my.png", // TODO: 添加非遗专用图标
      selectedIconPath: "/static/img/tabbar/icon-my-selected.png",
      text: "非遗",
      name: "feiyi"
    },
    {
      pagePath: "pages/my/my",
      iconPath: "/static/img/tabbar/icon-my.png",
      selectedIconPath: "/static/img/tabbar/icon-my-selected.png",
      text: "我的",
      name: "my"
    },
  ]
}

/**
 * 获取原生TabBar配置
 */
export const getNativeTabBarConfig = () => {
  return {
    color: tabbarConfig.color,
    selectedColor: tabbarConfig.selectedColor,
    borderStyle: tabbarConfig.borderStyle,
    backgroundColor: tabbarConfig.backgroundColor,
    list: tabbarConfig.list.map(item => ({
      pagePath: item.pagePath,
      iconPath: item.iconPath.replace('/', ''),
      selectedIconPath: item.selectedIconPath.replace('/', ''),
      text: item.text
    }))
  }
}

/**
 * 获取自定义TabBar配置
 */
export const getCustomTabBarConfig = () => {
  return tabbarConfig
}
